package com.shujia;

import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;

public class Demo08ClusterConn {
    public static void main(String[] args) {
        // 连接Redis集群
        JedisCluster cluster = new JedisCluster(new HostAndPort("master", 6381));

        // 使用上基本同单节点的各种操作一致
        System.out.println(cluster.get("s2"));

        System.out.println(cluster.get("s3"));

        cluster.close();


    }
}
